<template>
  <div class="app-container">
    <el-row>
      <el-col :span="8" v-for="team in teamList" :key="o" :offset="index > 0 ? 2 : 0">
        <el-card :body-style="{ padding: '20px' }" style="margin: 10px">
          <img :src= team.avatar class="image">
          <div style="padding: 14px;">
            <span>{{team.name}}</span>
            <div class="bottom clearfix">
              <span style="color: #1482f0">小组第{{team.groupRank}}出线</span>
              <el-button type="text" class="button" @click="detail">队伍详情</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import team from '@/api/dbwork/team'
  export default {
      data(){
        return{
          currentDate: new Date(),
          teamList:{}
        }
      },
      created() {
        this.getAll()
      },
      methods:{
          getAll(){
            team.getAllTeam()
            .then(response=>{
              this.teamList = response.data.list
            })
          },
          detail(){
            this.$router.push({path:'/team/detail'})
          }
      }
  }
</script>

<style>
  .time {
    font-size: 13px;
    color: #999;
  }
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 92%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }
</style>
